package com.woniu.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;

@Data
@Document(indexName = "items",shards =3,replicas=2)
public class Item {
    @Id
    private  Long id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private  String title;

    @Field(type =FieldType.Keyword)
    private  String category;

    @Field(type =FieldType.Keyword)
    private String brand;

    @Field(type =FieldType.Double)
    private BigDecimal priece;

    @Field(type =FieldType.Keyword,index = false)
    private String images;
}
